pcap_activate pcap_create
API 概述
pcap_activate pcap_create 是 libpcap 中的一个API。该规属于version-compat 类型。该规则是使用 Advance 生成的。
规则描述
提示
pcap_create() and pcap_activate() were not available in versions of libpcap prior to 1.0 if you are writing an application that must work on versions of libpcap prior to 1.0, either use pcap_open_live() to get a handle for a live capture or, if you want to be able to use the additional capabilities offered by using pcap_create() and pcap_activate(), use an autoconf(1) script or some other configuration script to check whether the libpcap 1.0 APIs are available and use them only if they are.
https://www.tcpdump.org/manpages/pcap.3pcap.html
信息
标签:version-compat
参数下标:N/A
CWE类别:N/A
规则代码
import cpp
from FunctionCall fc, PreprocessorDirective p
where fc.getTarget().hasQualifiedName("pcap_create")
and ((p instanceof PreprocessorIf
and p.getLocation().getFile().toString() = p.getLocation().getFile().toString()
and not (p.(PreprocessorIf).getEndIf().getLocation().getStartLine() > p.getLocation().getStartLine()
and p.(PreprocessorIf).getLocation().getStartLine() < p.getLocation().getStartLine()))
or
(p instanceof PreprocessorElif
and p.getLocation().getFile().toString() = p.getLocation().getFile().toString()
and not (p.(PreprocessorElif).getEndIf().getLocation().getStartLine() > p.getLocation().getStartLine()
and p.(PreprocessorElif).getLocation().getStartLine() < p.getLocation().getStartLine()))
or
(p instanceof PreprocessorElse
and p.getLocation().getFile().toString() = p.getLocation().getFile().toString()
and not (p.(PreprocessorElse).getEndIf().getLocation().getStartLine() > p.getLocation().getStartLine()
and p.(PreprocessorElse).getLocation().getStartLine() < p.getLocation().getStartLine()))
or
(p instanceof PreprocessorIfdef
and p.getLocation().getFile().toString() = p.getLocation().getFile().toString()
and not (p.(PreprocessorIfdef).getEndIf().getLocation().getStartLine() > p.getLocation().getStartLine()
and p.(PreprocessorIfdef).getLocation().getStartLine() < p.getLocation().getStartLine()))
or
(p instanceof PreprocessorIfndef
and p.getLocation().getFile().toString() = p.getLocation().getFile().toString()
and not (p.(PreprocessorIfndef).getEndIf().getLocation().getStartLine() > p.getLocation().getStartLine()
and p.(PreprocessorIfndef).getLocation().getStartLine() < p.getLocation().getStartLine()))
)
select fc.getLocation()